
package ui.activity.poscontrol.adapter;

import android.content.Context;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.List;

import base.BaseViewHolder;
import base.SuperBaseAdapter;
import ui.activity.poscontrol.beanmodel.PushBackPosBean;


/**
 *POS查询列表适配器
 * Created by chenjian on 19/2/27
 */
public class PushBackHistoryRecordMyPosAdapter extends SuperBaseAdapter<PushBackPosBean.RecordsBean> {

    List<PushBackPosBean.RecordsBean> mData = new ArrayList<>();
    Context mContext;
    public PushBackHistoryRecordMyPosAdapter(Context context, List<PushBackPosBean.RecordsBean> data) {
        super(context, data);
        mContext = context;
        mData = data;
    }
    public void refresh() {
    }

    @Override
    protected void convert(BaseViewHolder holder, final PushBackPosBean.RecordsBean item, final int position) {
        holder.setText(R.id.index, (position+1)+"")
                .setText(R.id.device_no, item.getPosSn())//终端编号

                .setText(R.id.return_usedate, item.getRemainingDay()+"");//截止日期
        if(item.getRemainingDay()<=10){
            holder.setTextColorRes(R.id.return_usedate,R.color.red_fe3333);
        }else {
            holder.setTextColorRes(R.id.return_usedate,R.color.tc_666666);
        }
        if(item.getStatus() == 1){
            holder.setText(R.id.return_amount_range, "已回拨");
            holder.setTextColorRes(R.id.return_amount_range,R.color.tc_666666);
        }else{
            holder.setText(R.id.return_amount_range, "被拒绝");
            holder.setTextColorRes(R.id.return_amount_range,R.color.red_fe3333);
        }

    }



    @Override
    protected int getItemViewLayoutId(int position, PushBackPosBean.RecordsBean item) {
        return R.layout.item_pushbackhistoryrecordmy_list;
    }

}
